import time

import allure
from page_base.page_base import Base
from page_element.el_roo import *
from utils.timer import sleep
import logging

class PageSettlement(Base):
    """登录页面"""
    def page_settlement(self):
        # 打开A3mall
        self.open_url(url)
        self.maximize_window()

        with allure.step(f"选择板块"):
            self.click(roo_login_page.settlement_btn)
            time.sleep(4)

        with allure.step("点击添加"):
            self.click(roo_login_page.add_btn)


        with allure.step("添加断言"):
                dy = self.text(roo_login_page.add_dy)
                assert "发起结算" == dy
                logging.info(f"验证成功")
        try:
                with allure.step("点击放大镜"):
                    self.click(roo_login_page.look)
                    time.sleep(4)
        except Exception as e:
                print(e)


        try:
            with allure.step("选择用户"):
                self.double_click(roo_login_page.choose_user)
                time.sleep(5)
        except Exception as e:
                print(e)




        # with allure.step("获取结算"):
        #     self.send_keys(roo_login_page.get_settlement,0)
        #
        #
        # with allure.step("获取结算"):
        #     self.send_keys(roo_login_page.get_settlement2,0)

        try:
            with allure.step("点击提交"):
                self.send_keys(roo_login_page.active_btn, 0)
                time.sleep(5)
        except Exception as e:
                print(e)





